home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / Ant Movie Catalog 3.5.0.2 / amc_install.exe / {app} / Scripts / Debug.pas < prev    next >
Pascal/Delphi Source File  |  2005-05-26  |  791b  |  42 lines

  1. unit Debug;
  2.  
  3. const
  4.   SourcePath = 't:\01\';
  5.  
  6. function GetLocalPage(Address: string): string;
  7. var
  8.   Page: TStringList;
  9.   FileName: string;
  10. begin
  11.   Page := TStringList.Create;
  12.   FileName := '';
  13.   Input('', 'File to read:', FileName);
  14.   Page.LoadFromFile(SourcePath + FileName + '.html');
  15.   Result := Page.Text;
  16.   Page.Free;
  17. end;
  18.  
  19. function SavePage(Address: string; FileName: string): string;
  20. var
  21.   Page: TStringList;
  22. begin
  23.   Page := TStringList.Create;
  24.   Page.Text := GetPage(Address);
  25.   Page.SaveToFile(FileName);
  26.   Result := Page.Text;
  27.   Page.Free;
  28. end;
  29.  
  30. procedure SaveToFile(Text: string; FileName: string);
  31. var
  32.   Page: TStringList;
  33. begin
  34.   Page := TStringList.Create;
  35.   Page.Text := Text;
  36.   Page.SaveToFile(FileName);
  37.   Page.Free;
  38. end;
  39.  
  40. begin
  41. end.
  42.